/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.sucresale.presentation;

import java.util.Map;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author User
 */
@ManagedBean(name = "ShowOrHideManagedBean")
@SessionScoped
public class ShowOrHideManagedBean {

    private boolean showComboEnsalada;
    private boolean showComboPasta;
    private boolean showNotas;
    private boolean showPostres;
    private boolean showBebidas;

    /** Creates a new instance of ShowOrHideManagedBean */
    public ShowOrHideManagedBean() {

        showBebidas = false;
        showComboEnsalada = false;
        showComboPasta = false;
        showNotas = false;
        showPostres = false;

    }

    public void changePanels() {

        Map params = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
        String action = params.get("action").toString();

        if (action.equals("comboEnsalada")) {

            showBebidas = true;
            showComboEnsalada = true;
            showComboPasta = false;
            showNotas = true;
            showPostres = true;



        } else if (action.equals("ensaladaSolo")) {

            showBebidas = false;
            showComboEnsalada = true;
            showComboPasta = false;
            showNotas = false;
            showPostres = false;

        } else if (action.equals("bebidas")) {

            showBebidas = true;
            showComboEnsalada = false;
            showComboPasta = false;
            showNotas = false;
            showPostres = false;

        } else if (action.equals("comboPasta")) {

            showBebidas = true;
            showComboEnsalada = false;
            showComboPasta = true;
            showNotas = true;
            showPostres = true;

        } else if (action.equals("pastaSolo")) {

            showBebidas = false;
            showComboEnsalada = false;
            showComboPasta = true;
            showNotas = false;
            showPostres = false;

        } else {

            showBebidas = false;
            showComboEnsalada = false;
            showComboPasta = false;
            showNotas = false;
            showPostres = true;

        }



    }

    public boolean isShowBebidas() {
        return showBebidas;
    }

    public void setShowBebidas(boolean showBebidas) {
        this.showBebidas = showBebidas;
    }

    public boolean isShowComboEnsalada() {
        return showComboEnsalada;
    }

    public void setShowComboEnsalada(boolean showComboEnsalada) {
        this.showComboEnsalada = showComboEnsalada;
    }

    public boolean isShowComboPasta() {
        return showComboPasta;
    }

    public void setShowComboPasta(boolean showComboPasta) {
        this.showComboPasta = showComboPasta;
    }

    public boolean isShowNotas() {
        return showNotas;
    }

    public void setShowNotas(boolean showNotas) {
        this.showNotas = showNotas;
    }

    public boolean isShowPostres() {
        return showPostres;
    }

    public void setShowPostres(boolean showPostres) {
        this.showPostres = showPostres;
    }
}
